/*
Date.prototype.__defineGetter__('ago',function(){
	var diff = (((new Date()).getTime() - this.getTime()) /1000),
	day_diff = Math.floor(diff/86400);
	return day_diff == 0 &&(
		diff <60 && "just now "||
		diff <120 && "1 minute ago"||
		diff <3600&& Math.floor(diff/60)+"minutes ago"||
		diff <7200 && "1 hours ago"||
		diff < 86400 && Math.floor(diff/3600)+"hours ago")||
	day_diff == 1 && "Yesterday"||
	day_diff < 7 && day_diff +"day ago"||
	Math.ceil(day_diff/7) + "weeks ago";

});

var a = new Date('12/12/1990') ;
console.log(a.ago);


var start = Date.now();
setTimeout(function(){
	console.log(Date.now() - start) ;
	for(var i = 0 ; i < 1000000000 ; i++){} 
},1000) ;

setTimeout(function(){
	console.log(Date.now() - start) ;
},2000)

console.log(1) ;
process.nextTick(function(){
	console.log(3);
})
console.log(2);

var EventEmitter = require('events').EventEmitter
, a = new EventEmitter ;

a.on('even',function(){
	console.log('event called');
});
console.log('fdga') ;
a.emit('even');
*/

var http = require('http')

http.createServer(function(req, res){
	res.writeHead(200, {'Content-Type':'text/html'}) ;
	res.write('<h1>Node.js</h1>') ;
	res.end('<p>Hello World</p>');
}).listen(3000);

console.log("HTTP server is listening at port 3000.") ;